feat: try to add savingAccount to bankATMLesson 17#525
feat: try to add savingAccount to bankATMLesson 17#525Tezz03 wants to merge 22 commits intocode-differently:mainfrom
Conversation
…sson9/dataprovider/montezBProviderProvider.java
|
|
||
| import com.codedifferently.lesson17.bank.exceptions.InsufficientFundsException; | ||
|
|
||
| public class BusinessAccount extends CheckingAccount { |
There was a problem hiding this comment.
Prolly should be called BusinessCheckingAccount for more clarity.
| * @throws InsufficientFundsException If there are insufficient funds in the account. | ||
| */ | ||
| @Override | ||
| public void withdraw(double amount) throws InsufficientFundsException { |
There was a problem hiding this comment.
Don't even need to override the superclass method since it does the same thing.
| * @param owners The owners of the account. | ||
| * @param initialBalance The initial balance of the account. | ||
| */ | ||
| public BusinessAccount(String accountNumber, Set<Customer> owners, double initialBalance) { |
There was a problem hiding this comment.
Need to check that one of the owners is a business, right?
| */ | ||
| public Check(String checkNumber, double amount, CheckingAccount account) { | ||
| if (amount < 0) { | ||
| public Check(String checkNumber, double amount, CheckingAccount account, SavingsAccount savings) { |
There was a problem hiding this comment.
Why did you need to change the constructor? You can only write checks against checking accounts.
|
|
||
|
|
||
| /** Represents a savings account, which does not support check writing. */ | ||
| public class SavingsAccount extends CheckingAccount { |
There was a problem hiding this comment.
This doesn't make sense to me. How is a savings account a kind of checking account?
| * @param check The amount to write on the check. | ||
| * @throws UnsupportedOperationException Always, since savings accounts don't support checks. | ||
| */ | ||
| public void writeCheck(Check check) { |
There was a problem hiding this comment.
Why even have this method if you can't write checks account savings accounts?
There was a problem hiding this comment.
Must be still WIP so I'll ignore for now.
| } | ||
|
|
||
| @Test | ||
| void writeCheck() { |
There was a problem hiding this comment.
Code formatting looks wrong, please fix.
anthonydmays
left a comment
There was a problem hiding this comment.
Your pull request names are still terrible. You should do something about that.
need an extension